package com.hitqz.robot.biz.business.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
class Node implements Comparable<Node>{
    int i;
    int j;
    List<int[]> path;
    // 距离终点的曼哈顿距离
    int lenToEnd;
    @Override
    public int compareTo(Node o) {
        return Integer.compare(lenToEnd+path.size(),o.lenToEnd+o.path.size());
    }

    @Override
    public String toString() {
        return "Node{" +
                "i=" + i +
                ", j=" + j +
                ", lenToEnd=" + lenToEnd +
                '}';
    }
}